<?php 
	session_start();
	if(strlen($_SESSION["u_name"])== 0)
	{
	 header("Location:index.php");
	}
	error_reporting(0);
	#---------File Include Starts--------------#
	include_once 'conf/db-config.php';
	include_once 'clsAdmissionConsulting.php';
	include 'Classes/MyClass.php';
	#---------File Include Ends----------------#


#---------Variable Declarations Starts--------------#
$objMyCass = new MyClass();
$userdetails = array();
$objAdmissionConsulting = new clsAdmissionConsulting();
$userdetails = $objMyCass->FetchUserRecords($_SESSION["user_id"]);
$logged_in_user_id = $_SESSION['user_id'];
if(strlen($_REQUEST['selectedUser'])>0)
{
	$userSelected = $_REQUEST['selectedUser'];
}
$arrUserAdmissionPackage = array();
$user_id_names =array();
if(strtoupper($userdetails['is_admin'])=="Y")
{
	$isAdmin="Y";
	$user_id_names = $objAdmissionConsulting->getAllIdNames();
	$arrUserAdmissionPackage = $objAdmissionConsulting->getPackageDetailsForUser($userSelected);
}
else
{
	$isAdmin="N";
	$arrUserAdmissionPackage = $objAdmissionConsulting->getPackageDetailsForUser($logged_in_user_id);
} 



#---------Variable Declarations Starts--------------#


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Admission Consulting</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script src="js/jquery-1.4.2.js" type="text/javascript" language="javascript"></script>
<script src="js/ajax.js" type="text/javascript" language="javascript"></script>
<script src="js/tab-view.js" type="text/javascript" language="javascript"></script>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="css/tab-view.css" rel="stylesheet" type="text/css" />
<link href="cssbuttons.css" rel="stylesheet" type="text/css">
<link href="skins/sample/sample.css" rel="stylesheet" type="text/css">
<script src="admission-consulting.js" type="text/javascript" language="javascript"></script>
</head>
<body>


<!-- container -->
<div id="container">
	<div class="center">
		<!-- header -->
		<div class="header">
			<div class="logo"><a href="#"><img src="images/logo.png" alt="" /></a></div>
			<div class="login">
				<div class="studentlogin">
					<!-- <h1>Student Login</h1>-->
					<div class="username">
						<!-- <p class="uname">Username:</p> -->
						<div class=""><!-- <input type="text" class="t_box" value="" /> --></div>
					</div>
					<div class="">
						<!-- <p class="uname">Password:</p> -->
						<div class=""><!-- <input type="password" class="t_box" value="" /> --></div>
					</div> 
					
				</div>
				
				<div class="logo1"><a href="#"><img src="images/logo1.png" alt="" /></a></div>
				<div style="text-align:right" ><?php if(strlen($_SESSION["u_name"])!= 0)
{ ?>Welcome ,<?php print $_SESSION["u_name"];}?>&nbsp;&nbsp;<?php if(strlen($_SESSION["u_name"])!= 0)
{ ?><a href="Logout.php">Log Out</a><?php } ?></div>
			</div>
			<div class="nav">
				<ul>
					<li><a href="Home.php" >Home</a></li>
					<li><a href="about-us.php">About Us</a></li>
					<li><a href="GmatPreparation.php" >GMAT Preperation</a></li> 
					<li><a href="AdmissionConsulting.php" class="select" >Admissions Consulting</a></li> 
					<li><a href="http://topmbaconsultant.com/forum/">MBA Forum</a></li> 
					<li><a href="contact-us.php">Contact Us</a></li>
				</ul>
			</div>
		</div>
		<!-- header -->
		<!-- middle -->

		<div class="middle">
		<table cellpadding="0" cellspacing="0" border="0" width="100%" class="friendBox">
		<tr>
			<td>&nbsp;</td>
		</tr>
		<?php 
		if(strtoupper($userdetails["is_admin"])=="Y")
		{
		?>
		<tr>
			<td align="center">
			<fieldset>
			<legend> For Admin Use Only: </legend>
			Please Select UserName:
				<select id="user_id" name="user_id" onchange="selectpackageForUser();">
					<option id="select" value="select">--Select--</option>
					<?php 
					if(count($user_id_names)>0)
					{
						
						foreach($user_id_names as $key=>$user_id_name)
						{
							?>
								<option <?php if($_REQUEST['selectedUser']== $user_id_name['user_id']) { echo "selected=selected"; } ?> id="<?php echo $user_id_name['user_name'];?>" value="<?php echo $user_id_name['user_id'];?>"><?php echo ucfirst($user_id_name['user_name']); ?></option>
							<?php
						}
					}
					?>
				</select>
				<br><br><br>
				<span style="font-family: verdana,Arial;font-size: 10px;color: #570101;float: right;width: 470px;">
				Selecting an username, You will be able to see his/her admission package details.
				</span>
				</fieldset>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
		<?php 
		}
		?>
		<tr>
			<td align="center">
			<?php if(strtoupper($userdetails["is_admin"])=="Y")
			{
				echo ucfirst($user_id_name['user_name'])."'s Admission packge:&nbsp;" ;
			}
			else
			{
			?>
			Your Admission packge:&nbsp;
			<?php }
			?>
		<!-- All Works STarts -->

<?php
#---------Get Value of User Admission Package To show into a dropdown----------#
?>

	<select id="ddlUserAdmissionConsultingPackage" name="ddlUserAdmissionConsultingPackage" >
		<option id="select" value="select">--Select--</option>
		<?php 
		if(count($arrUserAdmissionPackage)>0)
		{
			foreach($arrUserAdmissionPackage as $packageName)
			{
				?>
					<option id="<?php echo $packageName;?>" value="<?php echo $packageName;?>"><?php echo $packageName." Consulting Package"; ?></option>
				<?php
			}
		}
		?>
	</select>
	
<?php 
#--------------------------------------Ends------------------------------------#
?>
</td>
</tr>
	<tr>
		<td align="center">
			<div id="spaceForUserPackageDropdownDetails">
			<br />Please Select Your Packages:
					<select id="userpackage" name="userpackage" onchange="populateDivForConsultancy('<?php echo $logged_in_user_id; ?>','<?php echo $isAdmin; ?>')">
					<option id="select" value="select">--Select--</option>
						<?php
					    if($packageName>0) { ?>
						<option value="1" >Package 1</option>
						<option value="2" >Package 2</option>
						<option value="3" >Package 3</option>
						<option value="4" >Package 4</option>
						<option value="5" >Package 5</option>
						<?php } if($packageName>5) { ?>
						<option value="6" >Package 6</option>
						<option value="7" >Package 7</option>
						<option value="8" >Package 8</option>
						<option value="9" >Package 9</option>
						<option value="10" >Package 10</option>
						<?php } if ($packageName>10) { ?>
						<option value="11" >Package 11</option>
						<option value="12" >Package 12</option>
						<option value="13" >Package 13</option>
						<option value="14" >Package 14</option>
						<option value="15" >Package 15</option>
						<?php }  ?>
					</select>
			</div>
		</td>
	</tr>	
	<tr>
			<td>&nbsp;</td>
		</tr>	
		<tr>
		<td align="center">
		<?php if(strtoupper($userdetails["is_admin"])!="Y")
			{
		?>	
				<script>populateDivForConsultancy('<?php echo $logged_in_user_id; ?>');</script>
		<?php 
			}
		?>
			<div id="entryBox">
			</div>
		</td>
		</tr>
		<!--  All Works Ends -->
		<tr>
			<td>&nbsp;</td>
		</tr>
		</table>
		<div style="height: 25px;">&nbsp;</div>
		<div class="bar"><img src="images/ftopbg.png" alt=""/></div>
			</div>
		<!-- /middle -->
		<!-- footer -->
			<div class="footer">
				<ul>
					<li><a href="Home.php">Home</a></li>
					<li>|</li>
					<li><a href="about-us.php">About Us</a></li>
					<li>|</li>
					<li><a href="GmatPreparation.php">GMAT Preperation</a></li>
					<li>|</li>
					<li><a href="AdmissionConsulting.php">Admissions Consulting</a></li>
					<li>|</li>
					<li><a href="http://topmbaconsultant.com/forum/">MBA Blog</a></li>
					<li>|</li>
					<li><a href="contact-us.php">Contact Us</a></li>
				</ul>
			</div>
		<!-- /footer -->
	</div>
</div>
<!-- / container -->
 </body>
</html>